<?php
include_once('HTGPage.class.php');

$page = new HTGPage();

/* @var $utils Utils */
$utils = $page->myUtils;

/* @var $security HTSecurity */
$security = $page->mySecurity;

if(!($security->isAdmin())) {
	$page->redirectTo("home.php");
}



$subj = @$_REQUEST['blogSubj'];
$body = @$_REQUEST['blogText'];
$type = @$_REQUEST['blogType'];

if(!(empty($subj))) { //add the blog post
	$utils->addBlogPost($subj, $body, $type);
}



$page->preHeadCloseContent .= '
<link href="blog.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="nicedit/nicEdit.js"></script> 
<script type="text/javascript">
$(window).load(function() {
    nicEditors.allTextAreas();
});
</script>
'; //css then jscript stuff
$page->content .= $utils->get_include_contents('blogForm.html');

$page->display();
?>